<?php

class Student{

    private $name;

    // 构造方法
    public function __construct($name)
    {
        $this->name = $name;
        echo "{$name}出生了<br>";
    }

    // 析构方法
    public function __destruct()
    {
        // TODO: Implement __destruct() method.
        echo "{$this->name}销毁了<br>";

    }


}

// 测试
$stu1 = new Student('tom');
$stu1 = new Student('berry');
$stu1 = new Student('ketty');
echo "<hr>";